<template>
  <div class="max">
    <my-header :backBtn="true">
			<div slot="title">
				家长反馈
			</div>
		</my-header>
    <div class="cont-nof">
      <div class="weui-panel tl">
        <div class="weui-loadmore weui-loadmore_line" v-if="feedback.length==0">
          <span class="weui-loadmore__tips">暂无数据</span>
        </div>
        <div class="weui-panel__bd">
          <div class="weui-media-box weui-media-box_text pr" v-for="item in feedback" @click="seeDetail(item)">
						<img src="../../../static/img/weidu.png" v-if="item.read==0" alt="" class="pa" style="right: 0;top: 0;width: 30px;">
						<img src="../../../static/img/yidu.png" v-else alt="" class="pa" style="right: 0;top: 0;width: 30px;">
            <h4 class="weui-media-box__title">{{item.title}}</h4>
            <p class="weui-media-box__desc">{{item.content}}</p>
            <ul class="weui-media-box__info">
              <li class="weui-media-box__info__meta fr" style="padding: 0;">{{item.kindfolkName}}</li>
            </ul>
            <ul class="weui-media-box__info">
              <li class="weui-media-box__info__meta fr" style="padding: 0;">{{item.createTime}}</li>
            </ul>
          </div>
        </div>
      </div>
      <a href="javascript:void(0);" class="weui-cell weui-cell_link" v-if="params.current*params.size<=params.total">
        <div class="weui-cell__bd" @click="loadmore">查看更多</div>
      </a>
    </div>
  </div>
</template>

<script>
  import myFoot from '@/components/Footer.vue'

  export default {
    components: {
      myFoot,
    },
    data() {
      return {
        feedback: [],
        params: {
          current: 1,
          size: 10,
          pages: 0,
        },
      }
    },
    methods: {
      loadmore(loaded) {
        this.params.size += 10;
      },
      queryFn() { //请求数据
        this.$http.fetchFeedback(this.params).then(resp => {
          this.feedback = resp.data.records;
          this.params.current = resp.data.current;
          this.params.size = resp.data.size;
          this.params.total = resp.data.total;
        })
      },
      seeDetail(item) {
        this.$http.readKinsfolkFeedback(item);
        this.$router.push({
          path: '/feedbackContent',
          query: item
        });
      }
    },
    created() {
      this.queryFn();
    }
  }
</script>

<style>
</style>
